package com.java.huxb;

import com.java.huxb.annotation.AddAnnotation;

import java.lang.reflect.Method;

/**
 * @author huxb
 * @date 2020/3/24 0024 下午 10:22
 */
public class Test001 {

    public static void main(String[] args) throws Exception {
        Class<?> className = Class.forName("com.java.huxb.Test001");
        Method[] methods = className.getDeclaredMethods();

        for (Method method : methods) {
            AddAnnotation annotation = method.getAnnotation(AddAnnotation.class);
            if (annotation == null) {
                continue;
            }
            String[] arrs = annotation.arrs();
            System.out.println(arrs);
            int i = annotation.userId();
            System.out.println(i);
            String s = annotation.userName();
            System.out.println(s);
        }

    }

    @AddAnnotation(userId = 1, userName = "张三", arrs = {"1", "2", "3"})
    public void add() {

    }
}
